from rest_framework.serializers import ModelSerializer
from .models import *


class UserSer(ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'


class ShopSer(ModelSerializer):
    user = UserSer()

    class Meta:
        model = Shop
        fields = '__all__'


class KecSer(ModelSerializer):
    class Meta:
        model = KeCheng
        fields = '__all__'


class NianSer(ModelSerializer):
    nj = KecSer(many=True, read_only=True)

    class Meta:
        model = NianJi
        fields = '__all__'


class SUserSer(ModelSerializer):
    class Meta:
        model = SUser
        fields = '__all__'


class SSUserSer(ModelSerializer):
    types = NianJi()

    class Meta:
        model = SUser
        fields = '__all__'
